package com.atguigu.controller;

import com.atguigu.entities.CommonResult;
import com.atguigu.service.OrderFeignService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * TODO
 *
 * @Description
 * @Author dubao
 * @Date 2023年 05月 30日 11:09
 **/
@RestController
public class OrderFeignController {

    @Value("${server.port}")
    private String serverPort;
    @Resource
    private OrderFeignService orderFeignService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult getPaymentById(@PathVariable("id") long id) {
        return orderFeignService.getPaymentById(id);
    }

    @GetMapping(value = "/consumer/payment/feign/timeout")
    public String paymentFeignTimeOut() {

        return orderFeignService.paymentFeignTimeOut();
    }

}
